Skip to content

hs_serialized_database_info() custom allocator but no exposed misc free function #441

@ludvikjerabek

Description

@ludvikjerabek

According to the documentation a custom allocator can be used but there is no way to know if a custom allocator is being used.

According to docs:

hs_error_t hs_serialized_database_info(const char *bytes, size_t length, char **info)
Utility function providing information about a serialized database.

Parameters
bytes – Pointer to a serialized database.

length – Length in bytes of the serialized database.

info – On success, a string containing the version and platform information for the supplied serialized database is placed in the parameter. The string is allocated using the allocator supplied in hs_set_misc_allocator() (or malloc() if no allocator was set) and should be freed by the caller.

Returns
HS_SUCCESS on success, other values on failure.

The string is allocated using the allocator supplied in hs_set_misc_allocator() however hs_misc_free is not exposed.

Since hs_misc_free is not exposed you have to assume free() it would be far better if hs_misc_free was exposed to be used to free the memory.

The free free function should be exposed for any custom allocator overrides.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions