include/yarp/util/yp_string.h in yarp-0.6.0 vs include/yarp/util/yp_string.h in yarp-0.7.0

- old
+ new

@@ -34,11 +34,11 @@ // We want to use demand paging as much as possible in order to avoid having to // read the entire file into memory (which could be detrimental to performance // for large files). This means that if we're on windows we'll use // `MapViewOfFile`, on POSIX systems that have access to `mmap` we'll use // `mmap`, and on other POSIX systems we'll use `read`. -bool yp_string_mapped_init(yp_string_t *string, const char *filepath); +YP_EXPORTED_FUNCTION bool yp_string_mapped_init(yp_string_t *string, const char *filepath); // Returns the memory size associated with the string. size_t yp_string_memsize(const yp_string_t *string); // Ensure the string is owned. If it is not, then reinitialize it as owned and @@ -51,7 +51,11 @@ // Returns the start pointer associated with the string. YP_EXPORTED_FUNCTION const char * yp_string_source(const yp_string_t *string); // Free the associated memory of the given string. YP_EXPORTED_FUNCTION void yp_string_free(yp_string_t *string); + +// Returns the size of the yp_string_t struct. This is necessary to allocate the +// correct amount of memory in the FFI backend. +YP_EXPORTED_FUNCTION size_t yp_string_sizeof(void); #endif // YARP_STRING_H