You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by "Marvin Humphrey (JIRA)" <ji...@apache.org> on 2010/02/16 01:18:27 UTC

[jira] Created: (LUCY-100) Use alloca() for strings

Use alloca() for strings
------------------------

                 Key: LUCY-100
                 URL: https://issues.apache.org/jira/browse/LUCY-100
             Project: Lucy
          Issue Type: Improvement
          Components: Core
            Reporter: Marvin Humphrey
            Assignee: Marvin Humphrey
            Priority: Minor


For security and reliability, Lucy eschews C-style NULL-terminated strings
except when absolutely necessary, favoring CharBuf objects instead.  However,
we would prefer to keep structs opaque and to use stack memory instead of heap
memory for small string values.  Furthermore, we would like to use object
pointers consistently rather than object structs.

These ends can be achieved by deploying the the non-standard but widely
available stack memory allocator alloca().


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LUCY-100) Use alloca() for strings

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marvin Humphrey updated LUCY-100:
---------------------------------

    Attachment: alloca.diff

This patch allows us to hide the ZombieCharBuf struct definition everywhere
except for within the autogenerated VTable defs (where it is used for class
names) and a few test files.  It also allows us to clean up the autogenerated
XS bindings somewhat as we get to avoid some intermediate automatic variables.
Lastly, we get to use stack memory for assembling filepaths, which makes it
easier to avoid leaking memory when an IO exception occurs.

> Use alloca() for strings
> ------------------------
>
>                 Key: LUCY-100
>                 URL: https://issues.apache.org/jira/browse/LUCY-100
>             Project: Lucy
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>            Priority: Minor
>         Attachments: alloca.diff
>
>
> For security and reliability, Lucy eschews C-style NULL-terminated strings
> except when absolutely necessary, favoring CharBuf objects instead.  However,
> we would prefer to keep structs opaque and to use stack memory instead of heap
> memory for small string values.  Furthermore, we would like to use object
> pointers consistently rather than object structs.
> These ends can be achieved by deploying the the non-standard but widely
> available stack memory allocator alloca().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (LUCY-100) Use alloca() for strings

Posted by "Marvin Humphrey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCY-100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marvin Humphrey resolved LUCY-100.
----------------------------------

    Resolution: Fixed

Committed as r911870.

> Use alloca() for strings
> ------------------------
>
>                 Key: LUCY-100
>                 URL: https://issues.apache.org/jira/browse/LUCY-100
>             Project: Lucy
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>            Priority: Minor
>         Attachments: alloca.diff
>
>
> For security and reliability, Lucy eschews C-style NULL-terminated strings
> except when absolutely necessary, favoring CharBuf objects instead.  However,
> we would prefer to keep structs opaque and to use stack memory instead of heap
> memory for small string values.  Furthermore, we would like to use object
> pointers consistently rather than object structs.
> These ends can be achieved by deploying the the non-standard but widely
> available stack memory allocator alloca().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.