+MirCookie const* mir_cookie_from_buffer(void const* buffer, size_t size) +{ + if (size != mir::cookie::default_blob_size) + return NULL; + + return new MirCookie(buffer, size); +}
While it is extremely unlikely for operator new() (or any of the other code currently invoked here) to throw I think we should trap exceptions and not allow them to propagate from a C API.
« Back to merge proposal
+MirCookie const* mir_cookie_ from_buffer( void const* buffer, size_t size) :default_ blob_size)
+{
+ if (size != mir::cookie:
+ return NULL;
+
+ return new MirCookie(buffer, size);
+}
While it is extremely unlikely for operator new() (or any of the other code currently invoked here) to throw I think we should trap exceptions and not allow them to propagate from a C API.