[Mono-list] Managed equivalent of memset?

Frederik Carlier frederik.carlier at ugent.be
Tue Feb 20 07:26:10 EST 2007


Hi,

As a quick introduction, I'm trying to convert a C++.NET wrapper around
HTML Tidy to C#, because of the lack of a C++.NET compiler for Linux.
I'm by no means an expert in unmanaged code, but things are going well.

I am, however, hitting a problem with a struct. The C++ code that
initializes the struct reads as follows:

[C++]
m_errbuf = new TidyBuffer;
memset(m_errbuf,0,sizeof(TidyBuffer));
tidySetErrorBuffer(m_tdoc,m_errbuf);

Re-creating the struct and calling tidySetErrorBuffer is easy enough,
but what is the managed equivalent of memset? If I just 'omit' the
memset line, I get the following failed assertion:

mono: src/buffio.c:184: tidyBufPutByte: Assertion `buf != ((void *)0)'
failed.

Thanks,

Frederik.


More information about the Mono-list mailing list