Mozilla Framework Based on Templates (MFBT)

  • Revision slug: Mozilla/MFBT
  • Revision title: Mozilla Framework Based on Templates (MFBT)
  • Revision id: 6740
  • Created:
  • Creator: Waldo
  • Is current revision? No
  • Comment Start adding real documentation, directing the reader to the relevant source file; 180 words added, 3 words removed

Revision Content

The Mozilla Framework Based on Templates ("mfbt") is the central repository for macros, functions, and data structures used throughout Mozilla code, including in the JavaScript engine.  Its code resides in the {{ Source("mfbt/") }} source directory, but headers within it should be included using paths like "mozilla/StdInt.h".  It is fairly new, so its functionality is currently sparse.  Feel free to file bugs to add new functionality to it, or to move existing functionality into, it as needed.

mfbt code goes to some length to document all its interfaces in comments.  It also attempts to define its functionality in well-named files, such that simply skimming the contents of {{ Source("mfbt/") }} may .  Therefore this document primarily attempts to direct readers to the correct file to read those comments.  Feel free to file a documentation bug if you think this approach could be improved.

Functionality

Core

The <stdint.h> standard header is not available on all platforms, so mfbt provides the {{ Source("mfbt/StdInt.h", "mozilla/StdInt.h") }} header which implements its functionality.

If you need more than simply <stdint.h>, {{ Source("mfbt/Types.h") }} further provides size_t and macros to define imported and exported C symbols.

Various assertion macros -- both runtime assertions like MOZ_ASSERT and static, compile-time assertions like MOZ_STATIC_ASSERT -- are provided by {{ Source("mfbt/Assertions.h", "Assertions.h") }}.

Revision Source

<p>The Mozilla Framework Based on Templates ("mfbt") is the central repository for macros, functions, and data structures used throughout Mozilla code, including in the JavaScript engine.  Its code resides in the <code>{{ Source("mfbt/") }}</code> source directory, but headers within it should be included using paths like <code>"mozilla/StdInt.h"</code>.  It is fairly new, so its functionality is currently sparse.  Feel free to <a class="link-https" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&amp;product=MFBT" title="https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&amp;product=MFBT">file bugs</a> to add new functionality to it, or to move existing functionality into, it as needed.</p>
<p>mfbt code goes to some length to document all its interfaces in comments.  It also attempts to define its functionality in well-named files, such that simply skimming the contents of <code>{{ Source("mfbt/") }} may </code>.  Therefore this document primarily attempts to direct readers to the correct file to read those comments.  Feel free to file a <a class="link-https" href="https://bugzilla.mozilla.org/enter_bug.cgi?bug_status=NEW&amp;cc=mfbt%40core.bugs&amp;comment=&amp;component=Documentation%20Requests&amp;product=Mozilla%20Developer%20Network&amp;qa_contact=doc-request%40mdn.bugs&amp;rep_platform=All&amp;op_sys=All" title="https://bugzilla.mozilla.org/enter_bug.cgi?bug_status=NEW&amp;cc=mfbt%40core.bugs&amp;comment=&amp;component=Documentation%20Requests&amp;product=Mozilla%20Developer%20Network&amp;qa_contact=doc-request%40mdn.bugs&amp;rep_platform=All&amp;op_sys=All">documentation bug</a> if you think this approach could be improved.</p>
<h3>Functionality</h3>
<h4>Core</h4>
<p>The <code>&lt;stdint.h&gt;</code> standard header is not available on all platforms, so mfbt provides the <code>{{ Source("mfbt/StdInt.h", "mozilla/StdInt.h") }}</code> header which implements its functionality.</p>
<p>If you need more than simply <code>&lt;stdint.h&gt;</code>, <code>{{ Source("mfbt/Types.h") }}</code> further provides size_t and macros to define imported and exported C symbols.</p>
<p>Various assertion macros -- both runtime assertions like MOZ_ASSERT and static, compile-time assertions like MOZ_STATIC_ASSERT -- are provided by <code>{{ Source("mfbt/Assertions.h", "Assertions.h") }}</code>.</p>
Revert to this revision