Skip to content

Out of memory check and static memory implementation #56

Closed
@stawiski

Description

@stawiski

Hey guys,

I've used the library for a while in an embedded environment and noticed two things:

  • You don't support the case of failed memory allocation, which can happen in resource-constrained devices.
    In new_expr(...):
    te_expr *ret = malloc(size);
    memset(ret, 0, size);
  • It would be nice to have the option of static memory allocation for embedded applications. That is to drop malloc() whatsoever as a preprocessor configuration option, and preallocate the memory in a configurable size given by the user. That would limit of course the amount of parseable nested expressions to the given configured size.

Are you interested in implementing that or me dropping in some PRs?

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions